/*
 * @Author: hy
 * @Date: 2018-05-02 09:52:10
 * @Last Modified by: hy
 * @Last Modified time: 2018-05-16 21:31:03b4038
 */

// 提示弹窗

import React, { Component } from 'react'
import {
  Modal, Checkbox,
} from 'antd-mobile'
import { withRouter } from 'react-router-dom'
import Button from '@components/button'

@withRouter
export default class Home extends Component {
  constructor(props) {
    super(props)
    this.state = {
      // 不再提示
      noTips: false,
    }
  }


  /**
   * 关闭弹窗
   */
  onClose=() => {
    console.log('关闭弹窗')
  }

  /**
   * 点击确定
   */
  onOk=() => {
    this.props.onOk && this.props.onOk(this.state.noTips)
  }

  /**
   * 不在提示选择框
   */
  onCheck=(e) => {
    this.setState({
      noTips: e.target.checked,
    })
  }

  render() {
    return (
      <Modal
        visible
        transparent
        maskClosable={false}
        onClose={this.onClose}
        title="提示"
        footer={[]}
      >
        <div className="modal-wrap">
          <div className="modal-content">
            <p className="modal-tips">
                所有投注站均在工商备案，并且经过体彩中心认证，预约彩票均经过认证投注站彩机出票，可放心预约
            </p>
            <Checkbox.AgreeItem data-seed="logId" onChange={this.onCheck}>
              <p className="flex-row-base">不在提示</p>
            </Checkbox.AgreeItem>
          </div>
          <div className="modal-footer">
            <Button type="red" disabled={false} onClick={this.onOk}>确定</Button>
          </div>
        </div>
      </Modal>

    )
  }
}
